package cn.fql.controller;

import cn.fql.service.IVerifyCodeService;
import cn.fql.ymcc.result.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {
    @Autowired
    private IVerifyCodeService iVerifyCodeService;

    @GetMapping("/imageCode/{imageCodeKey}")
    public String getImgeCode(@PathVariable("imageCodeKey") String key){
        return iVerifyCodeService.getImgeCode(key);
    }

    //手机登录获取手机验证码接口
    @PostMapping("/sendSmsCode")
    public JSONResult getSmsCode(@RequestBody Map<String,String> map){
            //调用获取手机验证码方法
            iVerifyCodeService.getSmsCode(map);
            //返回结果
            return new JSONResult();
    }
}
